﻿<UserControl x:Class="road2.Views.CarUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
             xmlns:services="clr-namespace:road2.Services">
    
    <UserControl.Resources>
        <services:ColorBrushConverter x:Key="ColorBrushConv"/>
        <services:DistanaceLineMarginConverter x:Key="DLMConv"/>
    </UserControl.Resources>
    
    <Canvas Name="LayoutRoot">
        <Rectangle Name="CarRect" Canvas.ZIndex="99999"
                   Width="20" Height="10"
                   Stroke="Black" StrokeThickness="1"
                   Fill="{Binding Path=Color, Converter={StaticResource ColorBrushConv}}"
                   Opacity="1">
            <Rectangle.Margin>
                <MultiBinding Converter="{StaticResource DLMConv}">
                    <Binding Path="Distance"/>
                    <Binding Path="Line"/>
                </MultiBinding>
            </Rectangle.Margin>
        </Rectangle>
    </Canvas>
</UserControl>
